from wtforms_tornado import Form
from wtforms.validators import Length, DataRequired, Regexp
from wtforms import StringField


class GetCodeForm(Form):
    code = StringField("1688市场传过来的code", validators=[
        DataRequired(message="请输入code"),
        Length(min=36, max=36, message="code长度不对"),
        Regexp(regex="\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12}", message="code格式不对")
    ])
